<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>MarkDown富文本编辑器</title>
	<!-- <link rel="stylesheet" href="./css/prism.css"> -->
	<link rel="stylesheet" href="./simplemde/debug/simplemde.css" />
	<link rel="stylesheet" href="./css/font-awesome-4.7.0/css/font-awesome.css" />
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/highlight.js/latest/styles/github.min.css">
	<link rel="stylesheet" href="./css/ueditor.css">
	<style>
		.showCode{
			width: 100%;
			height:100%;
			border: 1px solid #ccc;

		}
		img{
			width: 750px;
		}
	</style>
</head>
<body>
	<textarea name="code" id="code" class="name" cols="30" rows="10"></textarea>
</body>
<!-- <script src="./js/prism.js"></script> -->
<script src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./simplemde/debug/simplemde.js"></script>
<script src="https://cdn.bootcss.com/showdown/1.3.0/showdown.min.js"></script>
<script>
$(function(){
	//富文本编辑器配置
	simplemde = new SimpleMDE({
	    autofocus: false,//是否自动对焦
	    //自定义样式文本块的某些按钮的行为方式
	    blockStyles: {
	        bold: "__",
	        italic: "_"
	    },
	    element: document.getElementById("code"),//选择器
	    indentWithTabs: true,//如果设置为false，则使用空格而不是制表符缩进。默认为true。
	    insertTexts: {
	        horizontalRule: ["", "\n\n-----\n\n"],
	        image: ["![](http://", ")"],
	        link: ["[", "](http://)"],
	        table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text     | Text      | Text     |\n\n"],
	    },
	    lineWrapping: false,//如果设置为false，则禁用换行。默认为true。
	    parsingConfig: {
	        allowAtxHeaderWithoutSpace: true,
	        strikethrough: true,
	        underscoresBreakWords: true,
	    },
	    placeholder: "请使用 Markdown 格式书写 ;-)，代码块请标语言,示例如下，否则无高亮\n```php\n//代码开始\n```\nOK！开始你的创作吧！",
	    promptURLs: false,
	    //快捷键
	    shortcuts: {
	        drawTable: "Cmd-Alt-T"
	    },
	    showIcons: ["code", "table"],
	    spellChecker: false,//检查拼音
	    status: true,
	    status: ["autosave", "lines", "words", "cursor"], // Optional usage
	    status: ["autosave", "lines", "words", "cursor", {
	        className: "keystrokes",
	        defaultValue: function(el) {
	            this.keystrokes = 0;
	            el.innerHTML = "0 Keystrokes";
	        },
	        onUpdate: function(el) {
	            el.innerHTML = ++this.keystrokes + " Keystrokes";
	        }
	    }], // Another optional usage, with a custom status bar item that counts keystrokes
	    styleSelectedText: false,
	    tabSize: 8,
	    toolbarTips:true,
	});
	// $("textarea").keyup(function(){
	// 	var content = simplemde.value();
	//   	var converter = new showdown.Converter();
 //            markdown_content = converter.makeHtml(content);
 //        $('.showCode').html(markdown_content);
	// });	
})
</script>
<script type="text/javascript" src="./js/upload.js"></script>
</html>